#include "State.h"

State::~State() {
	for(size_t i = 0; i < this->theItems.size(); ++i) {
		delete this->theItems[i];
	}
}

void State::handle(Event &anEvent) {
    for(size_t i = 0; i < this->theItems.size(); ++i) {
		this->theItems[i]->run( *(this->theFrame) , anEvent);
    }
}

void State::draw() {
	this->theFrame->print(this->theTitle);
    for(size_t i = 0; i < this->theItems.size(); ++i) {
        this->theFrame->print(this->theItems[i]->toString());
    }
}
